class CreateCoupons < ActiveRecord::Migration[5.2]
  def change
    create_table :coupons do |t|
      t.integer :category_id, comment: "跟分类id"
      t.integer :shop_id, comment: "商铺id"
      t.string :name, comment: "优惠券名字"
      t.text :remark, comment: "优惠券说明"
      t.datetime :start_at, comment: "优惠券开始使用时间"
      t.datetime :end_at, comment: "优惠券结束使用时间"
      t.decimal :money, :decimal, :precision => 10, :scale => 2, :default => 0.0, comment: "优惠金额"
      t.decimal :full_money, :decimal, :precision => 10, :scale => 2, :default => 0.0, comment: "金额满"
      t.integer :state, default: 0, comment: "优惠券状态"
      t.integer :shop_category_id

      t.timestamps
    end
  end
end
